package creatorMode.simpleFactoryPattern;

import java.util.EnumMap;

import static creatorMode.simpleFactoryPattern.type.*;

public class disCountFactory {
    private final static EnumMap<type, disCount> map;
    static {
        map=new EnumMap<>(type.class);
        map.put(PER_PRICE_DISCOUNT,new aDisCount());
        map.put( RATE_DISCOUNT,new bDisCount());
        map.put(NO_THRESHOLD,new cDisCount());
    }

    public static  disCount getdisCount(type t){
        return map.get(t);
    }
}
